//
//  ObjectTypeCast.swift
//  HinsLive
//
//  Created by haoxian on 2019/4/22.
//  Copyright © 2019 Hins. All rights reserved.
//

import Foundation
import RxCocoa


func castOrThrow<T>(_ resultType: T.Type, _ object: Any) throws -> T {
    guard let returnValue = object as? T else {
        throw RxCocoaError.castingError(object: object, targetType: resultType)
    }
    return returnValue
}
